package com.chlitina.store.modules.cash.model;

import java.util.ArrayList;
import java.util.List;

public class GiftCart {
	private List<StoreProductCart> systemProducts = new ArrayList<StoreProductCart>();
	private List<StoreProductCart> storeProducts = new ArrayList<StoreProductCart>();

	public List<StoreProductCart> getSystemProducts() {
		return systemProducts;
	}

	public void setSystemProducts(List<StoreProductCart> systemProducts) {
		this.systemProducts = systemProducts;
	}

	public List<StoreProductCart> getStoreProducts() {
		return storeProducts;
	}

	public void setStoreProducts(List<StoreProductCart> storeProducts) {
		this.storeProducts = storeProducts;
	}

	public void deleteStoreProduct(long id) {
		 for (StoreProductCart cart : storeProducts) {
			if(cart.getStoreProduct().getId().longValue()==id){
				storeProducts.remove(cart);
				break;
			}
		}
	}
	
	public void deleteSystemProduct(long id) {
		 for (StoreProductCart cart : systemProducts) {
			if(cart.getStoreProduct().getId().longValue()==id){
				systemProducts.remove(cart);
				break;
			}
		}
	}

	public void updateDesriptions() {
		 for (StoreProductCart cart : systemProducts) {
			 cart.updateDetails();
			}
		 for (StoreProductCart cart : storeProducts) {
			 cart.updateDetails();
			}
	}
}
